@echo off

;rem move into the Example Directory
set BATCHDIR=%~dp0%
cd /d %BATCHDIR%

;rem Check Installation supports this example
if EXIST ..\..\..\..\..\bin\%IMPERAS_ARCH%\checkinstall.exe (
  ..\..\..\..\..\bin\%IMPERAS_ARCH%\checkinstall.exe -p install.pkg --nobanner
  if ERRORLEVEL 1 (
    pause
    exit
  )
)

mingw32-make -C application clean all
mingw32-make -C platform    clean all NOVLNV=1
mingw32-make -C peripheral  clean all NOVLNV=1

rem mingw32-make -C application clean all > compile_ablication.log
rem mingw32-make -C platform    clean all NOVLNV=1 > compile_platform.log
rem mingw32-make -C byteRead    clean all NOVLNV=1 > compile_byteRead.log

platform\platform.%IMPERAS_ARCH%.exe application\application.elf

pause

